package com.jinjia.ordersys.service.impl;

import com.jinjia.ordersys.dao.PersonMapper;
import com.jinjia.ordersys.domain.Person;
import com.jinjia.ordersys.dto.PersonDto;
import com.jinjia.ordersys.service.PersonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 人员角色Service实现类
 * @Param:
 * @return:
 * @Author: fenghouzhi
 * @Date: 2018/11/5
 * @Time: 10:08 AM
 */
@Slf4j
@Service
public class PersonServiceImpl implements PersonService {

    @Resource
    private PersonMapper personMapper;

    @Override
    public List<Person> getAllPersonForBase() {
        return null;
    }

    @Override
    public Person getPersonInfoByOpenid(String openId) {
        return personMapper.getPersonInfoByOpenid(openId);
    }

    @Override
    public Person getPersonInfoByPersonId(Long personId) {
        return personMapper.getPersonInfoByPersonId(personId);
    }

    @Override
    public Integer addPerson(Person person) {
        return personMapper.addPerson(person);
    }

    @Override
    public List<PersonDto> getNotBindPersons(String searchName) {
        return personMapper.getNotBindPersons(searchName);
    }

    @Override
    public Integer updateOrBindPerson(Person person) {
        return personMapper.updatePersonInfo(person);
    }

    @Override
    public List<Person> getAllPersonForSaleType() {
        return personMapper.getAllPersonForSaleType();
    }

}